package io.github.veigara.tcp.framework.event;

/**
 * @author : zhouhx
 * @date : 2025/6/6 13:33
 */

import io.github.veigara.tcp.framework.model.DeviceType;
import lombok.Data;

/**
 * 设备事件
 */
@Data
public class DeviceEvent {
    private final String deviceId;
    private final DeviceEventType eventType;
    private final DeviceType deviceType;
    private final Object data;
    private final long timestamp;

    public DeviceEvent(String deviceId, DeviceEventType eventType, DeviceType deviceType) {
        this(deviceId, eventType, deviceType, null);
    }

    public DeviceEvent(String deviceId, DeviceEventType eventType,
                       DeviceType deviceType, Object data) {
        this.deviceId = deviceId;
        this.eventType = eventType;
        this.deviceType = deviceType;
        this.data = data;
        this.timestamp = System.currentTimeMillis();
    }

}
